public class Shangqiu {

    public static void main(String[] args) {
        System.out.println("hello world");
        // byte char short int long float double boolean
      /*  byte a =126;
        char b='a';
        short c=127;
        int i=7888;
        long p=78998556L;
        float aa=12.3f;
        double e=66.3;
        boolean cc=false; */
                                                            //字符串
        String s1="hello";
        String s2="shangqiu university";
                                                             //拼接字符串使用+
        String s3=s1+s2;
                                                            //sout \soutv

        System.out.println("s3 = " + s3);
                                                            //截取字符串substring
        String s4="abcdefghititjlmopqrstuvwxyz";
        //s4.substring(5,10).sout
                                                            //左闭右开区间（括号内不算）
        System.out.println(s4.substring(5, 10));
                                                             //查询字符串位置indexOf
        //s4.indexOf("x").sout
        System.out.println(s4.indexOf("c"));
        System.out.println(s4.indexOf("xyz"));
                                                            //找到位置23
        System.out.println(s4.indexOf("kxyz"));
                                                            //没找到返回-1

                                                           //字符串切分
        String s5="abcdef,ghijklm,nopqrst,uvwxyz";
        String[] sk = s5.split(",");//s5.sqlit("").var
                                                           //循坏 sk（变量名）.for
        for (int i1 = 0; i1 < sk.length; i1++) {
            System.out.print(sk[i1]+" ");
        }
                                                             //判断是否以某个字符串开头
        System.out.println(s5.startsWith("abc"));
                                                            //判断以某个字符串结尾
        System.out.println(s5.endsWith("xyz"));
        System.out.println(s5.endsWith("sx"));
                                                             //判断字符串相等equals
        String s6="abc";
        String s7="abc";
        String s8="akc";
        System.out.println(s6.equals(s7));
        System.out.println(s6.equals(s8));
                                                              //null和字符串比较 空值异常
        String s9=null;
        String s10="abc";
                                              //异常System.out.println(s9.equals(s10));
        if (s9==null){
            System.out.println("s9=null");
        }
        if(s9!=null){
            System.out.println("s9!=null");
        }
                                                                  //计算字符串长度length
        String s11="abcd";
        System.out.println(s11.length());
                                         //数组一定是类型确定长度确定
                                        //定义的时候赋值
        int a[]={1,2,3,4,5};
        int b11=a[1];
        System.out.println("b11 = " + b11);
                                                                    //定义后在赋值
        int a1[]=new int[5];
        a1[1]=1;
        a1[3]=4;
        for (int i1 = 0; i1 < a1.length; i1++) {
            System.out.println(a1[i1]);

        }
                                                                  //定义一个double值
        double[]d1=new double[5];
        d1[4]=12.3;
        for (int i = 0; i < d1.length; i++) {
            System.out.println(d1[4]);
        }
        boolean[] boll=new boolean[5];
        boll[4]=true;
        for (int i2 = 0; i2 < boll.length; i2++) {
            System.out.println(boll[4]);
        }
       int f=19;
        while(f<25)
        {
            System.out.println("f="+f);
            f++;

        }

    }

}
